Object.defineProperty(exports, "__esModule", {
  value: true
});
var PlayerDataManager = require("AA_PlayerDataManager");
var Excel = require("AA_Excel");
var Const_Game = require("AA_Const_Game");
var _def_HallGlobalVariable = function () {
  function _creator() {}
  Object.defineProperty(_creator, "shuiGuoLevelMap", {
    get: function () {
      var e = this;
      if (!this._shuiGuoLevelMap) {
        this._shuiGuoLevelMap = new Map();
        Excel.Excel.shuiguolevel_all.forEach(function (t) {
          e._shuiGuoLevelMap.has(t.shuiguoId) || e._shuiGuoLevelMap.set(t.shuiguoId, []);
          e._shuiGuoLevelMap.get(t.shuiguoId).push(t);
        });
      }
      return this._shuiGuoLevelMap;
    },
    enumerable: false,
    configurable: true
  });
  Object.defineProperty(_creator, "shuiGuoCiTiaoMap", {
    get: function () {
      var e = this;
      if (!this._shuiGuoCiTiaoMap) {
        this._shuiGuoCiTiaoMap = new Map();
        Excel.Excel.shuiguocitiao_all.forEach(function (t) {
          e._shuiGuoCiTiaoMap.has(t.shuiguoId) || e._shuiGuoCiTiaoMap.set(t.shuiguoId, []);
          e._shuiGuoCiTiaoMap.get(t.shuiguoId).push(t);
        });
      }
      return this._shuiGuoCiTiaoMap;
    },
    enumerable: false,
    configurable: true
  });
  _creator.GetUnLockCiTiao = function (e) {
    return 1 == e.citiaochuxian || 0 == e.shuiguoId || (console.log("水果id", e.shuiguoId), PlayerDataManager.PlayerDataMgr.GetEquipDataById(e.shuiguoId).level >= e.jiesuo);
  };
  _creator.GetShuiGuoCurrLevelData = function (e) {
    var t = Excel.Excel.shuiguo(e);
    var o = this.shuiGuoLevelMap.get(e);
    var r = PlayerDataManager.PlayerDataMgr.GetEquipDataById(e);
    var c = {
      atk: t.attack,
      atkSpeed: t.attackspeed,
      talent: [],
      buffIsBaiFenBi: false
    };
    var s = {
      atk: t.attack,
      atkSpeed: t.attackspeed,
      talent: [],
      buffIsBaiFenBi: false
    };
    var u = Excel.Excel.shuiguobuff(t.talent);
    if (u) {
      for (var l = 0; l < u.value.length; l++) {
        var d = u.value[l];
        c.talent.push(d);
        s.talent.push(d);
      }
      switch (e) {
        case Const_Game.FruitId.爆头瓜:
        case Const_Game.FruitId.榴莲王:
        case Const_Game.FruitId.香蕉射手:
        case Const_Game.FruitId.黄瓜大棒:
        case Const_Game.FruitId.辣妹子:
        case Const_Game.FruitId.冻斯梨:
        case Const_Game.FruitId.毒蘑菇:
        case Const_Game.FruitId.天山雪莲:
        case Const_Game.FruitId.元婴果:
        case Const_Game.FruitId.至尊棒:
        case Const_Game.FruitId.紫薯精:
          c.buffIsBaiFenBi = true;
          c.buffIsBaiFenBi = true;
      }
    }
    if (o) {
      for (l = 0; l < o.length; l++) {
        d = o[l];
        if (l < r.level - 1 && (c.atk += d.addattack, c.atkSpeed += d.addAtkSpeed, u)) {
          for (var p = 0; p < d.addbeidongbuff.length; p++) {
            var h = d.addbeidongbuff[p] || 0;
            c.talent[p] += h;
          }
        }
        if (l <= r.level - 1 && (s.atk += d.addattack, s.atkSpeed += d.addAtkSpeed, u)) {
          for (var f = 0; f < d.addbeidongbuff.length; f++) {
            h = d.addbeidongbuff[f] || 0;
            s.talent[f] += h;
          }
        }
      }
    }
    return [c, s];
  };
  _creator.GetSuiPian = function (e) {
    undefined === e && (e = [1, 0, 0]);
    var t = [[], [], []];
    Excel.Excel.shuiguo_all.forEach(function (e) {
      PlayerDataManager.PlayerDataMgr.GetEquipDataById(e.id).isUnLock && -1 != e.isShow && t[e.quality - 1].push(e);
    });
    var o = new Map();
    for (var a = 0; a < e.length; a++) {
      var r = e[a];
      if (0 != t[a].length) {
        for (var c = 0; c < r; c++) {
          var s = Math.floor(Math.random() * t[a].length);
          var u = t[a][s];
          o.has(u.id) || o.set(u.id, 0);
          var l = o.get(u.id);
          l++;
          o.set(u.id, l);
        }
      }
    }
    return o;
  };
  _creator.goldId = 999999;
  _creator.diamondId = 999998;
  _creator.powerId = 999997;
  _creator.shangZhenId = 999996;
  _creator.wuJinId = 999995;
  _creator.selfMap = {};
  _creator.isNeedResetWareHouse = false;
  return _creator;
}();
exports.default = _def_HallGlobalVariable;